function openBrWindow(theURL,winName,height,width,x,y) {  
  window.open(theURL,winName,'height='+height+', width='+width+', top='+y+', left='+x+', toolbar=no, menubar=no, url=no,scrollbars=yes, resizable=yes,location=no, status=yes');  
}  

_sys_userAgent = navigator.userAgent;   
_sys_browser = "";   
    
 if (chk_browser("Safari"))   
     _sys_browser = "Safari";   
 else if (chk_browser("Firefox"))   
     _sys_browser = "Firefox";   
 else if (chk_browser("MSIE 7"))   
     _sys_browser = "MSIE7";  
 else if (chk_browser("MSIE 6"))  
     _sys_browser = "MSIE6";  
 else  
     _sys_browser = "Others";  
    
 if (chk_browser("Firefox"))  
     document.onmousemove = FF_mouse_point;  
       
 function chk_browser(str)  
 {  
     if (_sys_userAgent.toUpperCase().indexOf(str.toUpperCase()) != -1)  
         return (true);  
     else  
         return (false);  
 }  
    
 function FF_mouse_point(_event)  
 {  
     if (chk_browser("Firefox"))  
     {  
         try  
         {  
             MOUSE_X = _event.clientX  
                 + document.body.scrollLeft  
                 + document.documentElement.scrollLeft;  
                   
             MOUSE_Y = _event.clientY  
                 + document.body.scrollTop  
                 + document.documentElement.scrollTop;  
         }  
         catch (e)  
         {  
             window.status = e.Message + " (" + MOUSE_X + ", " + MOUSE_Y + ")";  
             return (false);  
         }  
     }  
 }  
    
 function get_mouse_point()  
 {  
     var point = new Array();  
     var e = window.event;  
    
     if (chk_browser("Firefox"))  
     {  
         point.push(MOUSE_X);  
         point.push(MOUSE_Y);  
         return (point);  
     }  
    
     if (e)  
     {   
         if (e.pageX || e.pageY)  
         {  
             point.push(e.pageX);  
             point.push(e.pageY);  
         }  
         else if (e.clientX || e.clientY)  
         {  
                point.push(e.clientX  
                 + document.body.scrollLeft  
                 + document.documentElement.scrollLeft  
                 );  
             point.push(e.clientY  
                 + document.body.scrollTop  
                 + document.documentElement.scrollTop  
                 );  
         }  
     }  
       
     if (point[0] < 10)  
         point[0] = 10;  
    
     if (point[1] < 10)  
         point[1] = 10;  
       
     return (point);  
 }
 
 function get_screen_center()  
 {  
     var point = new Array();  
     var e = window.event;  
     
     var whight = window.screen.height; 
     var wwidth = window.screen.width;
    
     
    
     
     point.push((wwidth/4));
     point.push((whight/4));
     
     
    
       
     if (point[0] < 10)  
         point[0] = 10;  
    
     if (point[1] < 10)  
         point[1] = 10;  
       
     return (point);  
 }
 
 //去除字串左邊的空白虛格
function ltrim(instr){
return instr.replace(/^[\s]*/gi,"");
;
}

//去除字串右邊的空白虛格
function rtrim(instr){
	instr = instr.replace(/[\s]*$/gi,"");
	instr = instr.replace(/[\s(&nbsp;)]+$/g,"");
	
return instr;
}

//去除字串前後的空白虛格
function trim(instr){
instr = ltrim(instr);
instr = rtrim(instr);
return instr;
}



